# Settings contents

#:import Arma third_party.arma.Arma

<ArmaOptionsBox@BoxLayout>
    padding: 40, 20
    orientation: 'vertical'
    size_hint: 1, None
    screen: None
    top: (root.screen.top if root.screen else 0)
    height: 504

    ScrollView:
        size_hint: 1, None
        height: self.parent.height - 34
        bar_width: 12
        scroll_timeout: 100
        bar_inactive_color: 0.7, 0.7, 0.7, 0.5

        scroll_type: ['bars', 'content']

        GridLayout:
            id: scrollview_content
            cols: 1
            height: self.minimum_height
            width: self.parent.width / 2 - self.parent.bar_width
            size_hint: None, None

            # ==================================================================
            Label:
                text: 'Non-Arma options:'
                size_hint: None, None
                size: self.texture_size[0], 30

            CheckLabel:
                text: 'Run TrackIR at game start (if installed)'
                settings_name: 'run_trackir'

            CheckLabel:
                text: 'Run Opentrack at game start (if installed)'
                settings_name: 'run_opentrack'

            CheckLabel:
                text: 'Run FreeTrackNoIR at game start (if installed)'
                settings_name: 'run_facetracknoir'

            # ==================================================================
            Label:
                text: 'Basic options:'
                size_hint: None, None
                size: self.texture_size[0], 50

            CheckDropdownLabel:
                text: 'Profile name'
                settings_name: 'arma_name'
                values: Arma.get_player_profiles()

            CheckStringLabel:
                text: 'Arma 3 Unit (ID number)'
                settings_name: 'arma_unit'

            CheckLabel:
                text: 'Force 32-bit Arma executable (usually auto-detected!)'
                settings_name: 'arma_win32'

            CheckLabel:
                text: 'Force 64-bit Arma executable (usually auto-detected!)'
                settings_name: 'arma_win64'

            # ==================================================================
            Label:
                text: 'Advanced options:'
                size_hint: None, None
                size: self.texture_size[0], 50

            CheckLabel:
                text: 'Show script errors'
                settings_name: 'arma_showScriptErrors'

            CheckLabel:
                text: 'No pause'
                settings_name: 'arma_noPause'

            CheckLabel:
                text: 'Force window mode'
                settings_name: 'arma_window'

            CheckDropdownLabel:
                text: 'Extra threads'
                settings_name: 'arma_exThreads'
                values: ['0', '1', '3', '5', '7']

            CheckLabel:
                text: 'Huge pages'
                settings_name: 'arma_hugePages'

            # ==================================================================
            Label:
                text: 'Launcher authentication:'
                size_hint: None, None
                size: self.texture_size[0], 50

            StringLabel:
                text: 'Login:'
                settings_name: 'auth_login'
                on_field_value: root.screen.controller.request_mods_recheck(force_download_new=True)

            StringLabel:
                text: 'Password:'
                settings_name: 'auth_password'
                password: True
                on_field_value: root.screen.controller.request_mods_recheck(force_download_new=True)

# ==============================================================================
# Note: These options are appended to `scrollview_content` if `devmode_options`
# is set to true in devmode.conf
<devmode_options@GridLayout>:
    cols: 1
    height: self.minimum_height
    size_hint: 1, None

    Label:
        text: 'Devmode options:'
        size_hint: None, None
        size: self.texture_size[0], 50

    CheckFileLabel:
        text: 'Mission file (editor)'
        settings_name: 'arma_mission_file'
        hint_text: '<path to the file>'

    CheckLabel:
        text: 'Allow file patching'
        settings_name: 'arma_filePatching'

    CheckLabel:
        text: 'Check signatures at start'
        settings_name: 'arma_checkSignatures'

    CheckLabel:
        text: 'No sound'
        settings_name: 'arma_noSound'

    StringLabel:
        text: 'Additional parameters'
        hint_text: '<separated by space>'
        settings_name: 'arma_additionalParameters'


    Label:
        text: 'Get all the torrent urls for:'
        size_hint: None, None
        size: self.texture_size[0], 50

    GridLayout:
        rows: 1
        height: 30
        size_hint: 1, None
        size_hint_y: None
        spacing: 10

        Button:
            text: 'Base + Current server'
            size_hint: None, 1
            width: self.texture_size[0] + self.border[0] * 2
            on_release: root.show_torrents('base_server')

        Button:
            text: 'Curent server'
            size_hint: None, 1
            width: self.texture_size[0] + self.border[0] * 2
            on_release: root.show_torrents('server')

        Button:
            text: 'Base mods'
            size_hint: None, 1
            width: self.texture_size[0] + self.border[0] * 2
            on_release: root.show_torrents('base')

        Button:
            text: 'Everything'
            size_hint: None, 1
            width: self.texture_size[0] + self.border[0] * 2
            on_release: root.show_torrents('all')
